<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language=pt-BR"></script>
<script type="text/javascript" src="http://geoxml3.googlecode.com/svn/branches/polys/geoxml3.js"></script>
<script type="text/javascript" src="http://geoxml3.googlecode.com/svn/trunk/ProjectedOverlay.js"></script>
<script type="text/javascript">
  var map;
  var geoXml;
  var bufferXml;
  
  function initialize() {
    var latlng = new google.maps.LatLng(-7.232604194138538, -35.8865647578125);
    var myOptions = {
      zoom: 8,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  }
  
  function addKMLLayer(){
	  if(!geoXml){
		  geoXml = new geoXML3.parser({
		        map: map,
		        singleInfoWindow: true
		        // zoom: false,
		        //afterParse: useTheData
		    });
		    geoXml.parse('http://localhost:8080/sig/acudesKml.action');
	  }else{
		 
	  }
  }
  
  function addBuffer(){
	  if(!bufferXml){
		  bufferXml = new geoXML3.parser({
		        map: map,
		        singleInfoWindow: true
		        // zoom: false,
		        //afterParse: useTheData
		    });
		  bufferXml.parse('http://localhost:8080/sig/bufferKml.action');
	  }else{
		 
	  }
  }

</script>
</head>
<body onload="initialize()">
  <table style="width:100%; height:100%" border="1">
  	<tr>
  		<td style="width:30%; height:100%">
  			<div id="map_control" style="width:100%; height:100%">
  				<table style="width:30%; height:20%">
  					<tr>
  						<td>
  							<input type="button" value="KMLLayer" onclick="addKMLLayer()" />
  						</td>
  					</tr>
  					<tr>
  						<td>
  							<input type="button" value="Buffer" onclick="addBuffer()" />
  						</td>
  					</tr>
  				</table>
  			</div>
  		</td>
  		<td id="map_column" style="width:70%; height:100%">
  			<div id="map_canvas" style="width:900; height:700"></div>
  		</td>
  	</tr>
  </table>
</body>
</html>